<?php
    $role_type  = C('Common.account_type');
    // 初始化值
    init_input_val(array('role_type'),$_data);
?>
<body>
<div class="wrap J_check_wrap">
    <div class="nav">
        <ul class="cc">
            <li class="current"><a href="<?php echo U('Admin/UserRole/index'); ?>">角色管理</a></li>
        </ul>
    </div>
    <div class="h_a">提示信息</div>
    <div class="mb10 prompt_text">
        <ol>
            <li>绑定用户角色请在用户管理处设置。</li>
        </ol>
    </div>
    
    <div class="mb10"><a class="btn J_dialog" href="<?php echo U('Admin/UserRole/add'); ?>" title="添加角色" role="button"><span class="add"></span>添加角色</a></div>
    
    <div class="h_a">检索</div>
    <div class="search_type cc mb10">
        <form action="<?php echo U('Admin/UserRole/index'); ?>" method="post">
         <?php echo select('role_type',$role_type,$_data['role_type'],'角色区分',array('class'=>'select_2 w90')); ?>
         <button type="submit" class="btn">搜索</button>
        </form>
    </div>
    
    <form method="post" action="#" id="J_tag_form" class="J_ajaxForm">
    
    <div class="table_list">
        <table width="100%">
            <thead>
                <tr>
                    <td width="60"><label><input class="J_check_all" data-checklist="J_check_x" data-direction="x" type="checkbox">全选</label></td>
                    <td>角色名称</td>
                    <td>角色区分</td>
                    <td>备注信息</td>
                    <td>添加日期</td>
                    <td>操作</td>
                </tr>
            </thead>
            <?php if(!empty($roles)): ?>
            <tbody id="J_tag_list">
                <?php foreach($roles as $role): ?>
                <tr>
                <td>
                <?php if($role['id'] != 1): ?>
                <input class="J_check" name="id[]" value="<?php echo $role['id']; ?>" data-xid="J_check_x" data-yid="J_check_y" type="checkbox">
                <?php endif; ?>
                </td>
                <td><?php echo $role['name']; ?></td>
                <td><?php echo set_key_val($role['role_type'],$role_type); ?></td>
                <td><?php echo $role['remark']; ?></td>
                <td><?php echo $role['created']; ?></td>
                <td>
                <?php if($role['id'] != 1): ?>
                <a href="<?php echo U('Admin/UserRole/edit',array('rid'=>$role['id'])); ?>" class="J_dialog" title="角色编辑" class="mr5">[编辑]</a>
                &nbsp;
                <a href="<?php echo U('Admin/UserRole/auth',array('rid'=>$role['id'])); ?>" class="mr5">[权限]</a>
                <?php endif; ?>
                </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
            <?php endif; ?>
        </table>
        <div class="p10">
            <div class="pages">
                <?php echo $p; ?>
            </div>
        </div>
    </div>
    
    <div class="btn_wrap">
        <div class="btn_wrap_pd" id="J_sub_wrap">
            <label class="mr10"><input class="J_check_all" data-checklist="J_check_y" data-direction="y" type="checkbox">全选</label>
            <button class="btn J_ajax_submit_btn" data-subcheck="true" data-msg="确定要删除吗?" data-action="<?php echo U('Admin/UserRole/delete'); ?>" type="submit">删除选中</button>
        </div>
    </div>
    
    </form>
</div>

</body>